/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author sky
 */
@Embeddable
public class SongPlayListPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "PLAY_LIST_ID")
    private long playListId;
    @Basic(optional = false)
    @Column(name = "SONG_ID")
    private long songId;

    public SongPlayListPK() {
    }

    public SongPlayListPK(long playListId, long songId) {
        this.playListId = playListId;
        this.songId = songId;
    }

    public long getPlayListId() {
        return playListId;
    }

    public void setPlayListId(long playListId) {
        this.playListId = playListId;
    }

    public long getSongId() {
        return songId;
    }

    public void setSongId(long songId) {
        this.songId = songId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) playListId;
        hash += (int) songId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongPlayListPK)) {
            return false;
        }
        SongPlayListPK other = (SongPlayListPK) object;
        if (this.playListId != other.playListId) {
            return false;
        }
        if (this.songId != other.songId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "radiostation.SongPlayListPK[ playListId=" + playListId + ", songId=" + songId + " ]";
    }
    
}
